﻿@model IEnumerable<ServerManager.Models.App>

@{
    ViewData["Title"] = "Index";
}

<div style="height:40px;line-height:40px;margin-top:10px;">
    <div style="float:left;font-size:2em;">应用列表</div>
    <div style="float:right"><a class="btn btn-success" asp-action="CreateOrUpdate">新建</a></div>
</div>
<hr />
<table class="table">
    <thead>
        <tr>
            <th></th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Url)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Manager)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Remark)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Server)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @{ int i = 1; }
        @foreach (var item in Model)
        {
            <tr>
                <td>@(i++)</td>
                <td>
                    <a asp-action="Details" asp-route-id="@item.Id">
                        @Html.DisplayFor(modelItem => item.Name)
                    </a>
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Url)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Manager)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Remark)
                </td>
                <td>
                    <a asp-controller="Server" asp-action="Details" asp-route-id="@item.Server.Id">
                        @Html.DisplayFor(modelItem => item.Server.Position)</a>
                </td>
                <td>
                    <a class="btn btn-info" asp-action="CreateOrUpdate" asp-route-id="@item.Id">编辑</a>
                </td>
            </tr>
        }
    </tbody>
</table>
